import cv2
import numpy as np
img =cv2.imread("9\\1.jpg")
img1=img[:,:,2]
kernel=np.ones((1,3),np.uint8)
erosion=cv2.erode(img1,kernel,iterations=18)
cv2.imshow("img1",img1)
cv2.imshow("erosion",erosion)
cv2.waitKey()
cv2.destroyAllWindows()